home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / EDUCMATH / CURVEFIT.LZH / CURVEFIT.ARC / CURVEFIT.DOC < prev    next >
Text File  |  1988-07-30  |  39KB  |  656 lines

  1. DOCUMENTATION FOR THE CURVEFIT PROGRAM (Documentation File Updated 7/29/88)
  2. ───────────────────────────────────────────────────────────────────────────
  3.  
  4. Introduction:
  5.  
  6. ╔═══════════╦══════════════════════════════════════════════════════╦══════════╗
  7. ║ CURVEFIT  ║ Version 2.11-A  JULY 29, 1988      by  Thomas S. Cox ║SHAREWARE ║
  8. ╠═══════════╩══════════════════════════════════════════════════════╩══════════╣
  9. ║ PURPOSE     This program performs a least squares curve fit on X, Y data.   ║
  10. ║             Curves for 25 equations are fitted.  Equation coefficients,     ║
  11. ║             Correlation Coefficient, and Best Fit are computed.  For any    ║
  12. ║             of the 25 equations, predictions for Y can be calculated.       ║
  13. ║                                                                             ║
  14. ║ REFERENCE   CURVE FITTING FOR PROGRAMMABLE CALCULATORS by William M. Kolb   ║
  15. ║             Published by: IMTEC  P. O. Box 1402  Bowie MD  20716            ║
  16. ║                                                                             ║
  17. ║ WARNING     A 'LINEARIZING' technique is applied to various equations so    ║
  18. ║ and         the resulting equations are of the general form: Y=A=B*X        ║
  19. ║ DISCLAIMER  This means that sum of squares of errors in Y are not minimized,║
  20. ║             but the sum of squares of the linearized variable are minimized.║
  21. ║                                                                             ║
  22. ║             Linear, Parabolic, Cubic, and Hyperbolic equations are linear   ║
  23. ║             in the parameters so this reservation does not apply to those   ║
  24. ║             curves. Reservation applies to equations with LN, EXP or POWERS.║
  25. ║                                                                             ║
  26. ║ SHAREWARE   If you use this program, a donation of $10 is requested.        ║
  27. ╠═════════════════════════════════════════════════════════════════════════════╣
  28. ║      PROGRAM   Compiled using Microsoft's Quick Basic Version 3.0           ║
  29. ║                ASCII source file is also supplied.                          ║
  30. ║                                                                             ║
  31. ║      ACCURACY:  Double precision routines are used to insure                ║
  32. ║                 accuracy.  No exponentiation routines are used.             ║
  33. ║                                                                             ║
  34. ║      COMMENTS:  IBM line graphics characters are used in this program.      ║
  35. ║                                                                             ║
  36. ║                 This  implementation supports positive, negative and        ║
  37. ║                 zero values for X and Y.  255 points are permitted.         ║
  38. ║                                                                             ║
  39. ║                 This program uses the LOCATE command extensively for        ║
  40. ║                 improved ease of data entry and data changes.  Printer      ║
  41. ║                 may be used with this program, but is not required.         ║
  42. ║                                                                             ║
  43. ║                 For equation 9, R squared is not computed.                  ║
  44. ║                 No formula was given in the reference source.               ║
  45. ║                                                                             ║
  46. ║                 This program will automatically DELETE any blank or         ║
  47. ║                 null lines that are created at the top of a                 ║
  48. ║                 LOTUS 1-2-3 .PRN file.                                      ║
  49. ║                                                                             ║
  50. ╚═════════════════════════════════════════════════════════════════════════════╝
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 1
  58.  
  59.  
  60.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  61.  
  62.  Main Program Menu:
  63. ╔═══════════╦══════════════════════════════════════════════════════╦══════════╗
  64. ║ CURVEFIT  ║  Version 2.11-B  JULY 29, 1988      by Thomas S. Cox ║SHAREWARE ║
  65. ╠═══════════╩══════════╤═══════════════════════════════════════════╩══════════╣
  66. ║ QUICK BASIC 3.0 VERS.│             M A S T E R    M E N U                   ║
  67. ╠═══════════╦══════════╪══════════════════════════════════════════════════════╣
  68. ║  SELECT   ║ CHOICES  │ BRIEF DESCRIPTION OF CHOICES                         ║
  69. ╠═════════╦═╬══════════╪══════════════════════════════════════════════════════╣
  70. ║      F1 ║ ║ ENTER    │ New Data (X and Y values)                            ║
  71. ║      F2 ║ ║ LOAD     │ A Previously Stored Data File                        ║
  72. ║      F3 ║ ║ ADD      │ Data to Values of X and Y Currently in Memory        ║
  73. ║      F4 ║ ║ DELETE   │ or CHANGE Values of X and Y Currently in Memory      ║
  74. ║      F5 ║ ║ LIST     │ X and Y Values Currently in Memory                   ║
  75. ║      F6 ║ ║ CALCULATE│ Equation Coefficients (A, B, C, and R^2)             ║
  76. ║      F7 ║ ║ PREDICT  │ Value of Y, given Value of X                         ║
  77. ║      F8 ║ ║ SHOW     │ LIST of EQUATIONS Fitted Using this Program          ║
  78. ║      F9 ║ ║ REVIEW   │ Equation Coefficients (A, B, C, R^2)                 ║
  79. ║     F10 ║ ║ DISPLAY  │ List of SUMS and SUMS of SQUARES                     ║
  80. ║ SHFT F1 ║ ║ STORE    │ X and Y Data Points to a DISK FILE                   ║
  81. ║ SHFT F2 ║ ║ EXIT     │ Leave Program and EXIT to DOS                        ║
  82. ║ SHFT F3 ║ ║ BEST FIT │ Sorted by R² (Coefficients MUST have been calculated)║
  83. ║ SHFT F4 ║ ║ MONITOR  │ Select COLOR or MONOCHROME (Default is COLOR + HERC) ║
  84. ╠═════════╩═╩══════════╧══════════════════════════════════════════════════════╣
  85. ║ Use UP or DOWN Arrows, Press ENTER to SELECT; or FUNCTION KEYS <ESC> to EXIT║
  86. ╚═════════════════════════════════════════════════════════════════════════════╝
  87.  
  88.  1.  ENTER New Data   Clears out any previously entered data to prepare
  89.                       for new data entry.
  90.  2.  LOAD Data        Load previously stored data from a disk file.  Over-
  91.                       writes any existing data.  May use a comma or space
  92.                       separated file, LOTUS or SuperCalc PRN files, or files
  93.                       created by CURVEFIT.
  94.  3.  ADD Data         Add data to previously entered data.  Once data are
  95.                       added, coefficients should be recalculated to reflect
  96.                       the effect of the additions.
  97.  4.  CORRECTIONS      Delete or Change any data point.  Coefficients should
  98.                       be recalculated to reflect the effect of any changes.
  99.  5.  LIST DATA        Will show on screen or printer the current values of
  100.                       X and Y.
  101.  6.  CALCULATE        Calculates the equation coefficients and value of R².
  102.  7.  PREDICT          Enter a range of X values and equation number (1-25).
  103.                       Will calculate predicted value for Y.
  104.  8.  SHOW             Show on screen list of equations fitted using CURVEFIT.
  105.  9.  REVIEW           Show coefficients (A, B, C) and R².
  106. 10.  LIST SUMS        Lists all sums and sums of squares.
  107. 11.  STORE            Stores current X and Y data points to a disk file.
  108. 12.  EXIT             Leave program and exit to DOS.  Option to save Data.
  109. 13.  BEST FIT         Shows equations sorted by value of R² for R²>0.10
  110. 14.  MONITOR          Choice of Color or Monochrome.  Default is Color.
  111.                       If a color monitor is used, text is white on a blue
  112.                       background.  Color choice also works with Hercules
  113.                       compatible cards.  Monochrome choice is appropriate
  114.                       only with straight monochrome card.
  115.  
  116.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 2
  117.  
  118.  
  119.  
  120.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  121.  
  122. ╔═══════════════════════════════════════════════════════════════════════════╗
  123. ║                      EQUATIONS FITTED USING THIS PROGRAM                  ║
  124. ╠════════════════════════════════════╦══════════════════════════════════════╣
  125. ║  1. Y=A+B*X       STR. LINE        ║   2. Y=B*X           LINE THRU ORG.  ║
  126. ║  3. Y=1/(A+B*X)   REC. STR LINE    ║   4. Y=A+B*X+C/X     LIN AND RECIP.  ║
  127. ║  5. Y=A+B/X       HYPERBOLA        ║   6. Y=X/(A*X+B)     RECIP HYPERBOLA ║
  128. ║  7. Y=A+B/X+C/X*X 2ND ORD HYP      ║   8. Y=A+B*X+C*X*X   PARABOLA        ║
  129. ║  9. Y=A*X+B*X*X   PAR AT ORIGIN    ║  10. Y=A*X^B         POWER           ║
  130. ║ 11. Y=A*B^X       MOD. POWER       ║  12. Y=A*B^(1/X)     ROOT            ║
  131. ║ 13. Y=A*X^(B*X)   SUPER GEOMET.    ║  14. Y=A*X^(B/X)     MOD GEOMETRIC   ║
  132. ║ 15. Y=A*e^(B*X)   EXPONENTIAL      ║  16. Y=A*e^(B/X)     MOD EXPONENTIAL ║
  133. ║ 17. Y=A+B*ln(X)   LOGARITHMIC      ║  18. Y=1/(A+B*ln(X))   RECIP LOG     ║
  134. ║ 19. Y=A*B^X*X^C   HOERL FUNCTION   ║  20. Y=A*B^(1/X)*X^C   MOD HOERL     ║
  135. ║ 21. Y=A*e^(((X-B)^2/)/C) NORMAL    ║  22. Y=A*e^((ln(X)-B)^2/C) LOG NORMAL║
  136. ║ 23. Y=A*X^B*(1-X)^C   BETA         ║  24. Y=A*(X/B)^C*e^(X/B)   GAMMA     ║
  137. ║ 25. Y=1/(A*(X+B)^2+C) CAUCHY       ║                                      ║
  138. ╠════════════════════════════════════╩══════════════════════════════════════╣
  139. ║      NOTES:  A.  Values of X and Y may be positive, negative, or zero     ║
  140. ║              B.  Only 255 values of X and Y can be used.                  ║
  141. ╠═══════════════════════════════════════════════════════════════════════════╣
  142. ║      Press <RETURN> to continue program execution                         ║
  143. ╚═══════════════════════════════════════════════════════════════════════════╝
  144. Note: Equations 19 and 24 and Equations 12 and 16 are essentially identical.
  145.  
  146.         BRIEF EXPLANATION OF EQUATIONS:
  147.  
  148.        1.   Straight Line                         Full Accuracy Least Squares
  149.        2.   Straight Line through the Origin      Full Accuracy Least Squares
  150.        3.   Reciprocal of Straight Line           Full Accuracy Least Squares
  151.        4.   Combined Linear and Reciprocal        Full Accuracy Least Squares
  152.        5.   Hyperbola                             Full Accuracy Least Squares
  153.        6.   Reciprocal of a Hyperbola             Full Accuracy Least Squares
  154.        7.   Second Order Hyperbola                Full Accuracy Least Squares
  155.        8.   Parabola                              Full Accuracy Least Squares
  156.        9.   Parabola Through Origin               Full Accuracy Least Squares
  157.       10.  Power                                  LINEARIZED
  158.       11.  Modified Power                         LINEARIZED
  159.       12.  Root (Modification of Modified Power)  LINEARIZED
  160.       13.  Super Geometric                        LINEARIZED
  161.       14.  Modified Geometric                     LINEARIZED
  162.       15.  Exponential                            LINEARIZED
  163.       16.  Modified Exponential (Similar to Root) LINEARIZED
  164.       17.  Logarithmic                            LINEARIZED
  165.       18.  Reciprocal of Logarithmic              LINEARIZED
  166.       19.  Hoerl's Equation                       LINEARIZED
  167.       20.  Modified Hoerl's Equation              LINEARIZED
  168.       21.  Normal Distribution (Gaussian)         LINEARIZED
  169.       22.  Log Normal                             LINEARIZED
  170.       23.  Beta Distribution (0<X<1)              LINEARIZED
  171.       24.  Gamma Distribution                     LINEARIZED
  172.       25.  Cauchy Distribution                    LINEARIZED
  173.  
  174.  
  175.  
  176.  
  177.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 3
  178.  
  179.  
  180.  
  181.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  182.  
  183.     LISTING OF SUMS AND SUMS OF SQUARES (DEFINITION)
  184.  
  185.     The array R() is used to hold these values.  The contents are:
  186.  
  187.                     R(16)=R(16)+X(I)             Note: R(1) through R(15)
  188.                     R(17)=R(17)+X(I)*X(I)              are not used by this
  189.                     R(18)=R(18)+Y(I)                   program.
  190.                     R(19)=R(19)+Y(I)*Y(I)
  191.                     R(20)=R(20)+X(I)*Y(I)
  192.                     R(21)=I
  193.                     R(22)=R(22)+(1/X(I))
  194.                     R(23)=R(23)+(1/(X(I)*X(I)))
  195.                     R(24)=R(24)+(1/(Y(I)))
  196.                     R(25)=R(25)+(1/(Y(I)*Y(I)))
  197.                     R(26)=R(26)+(1/(Y(I)*X(I)))
  198.                     R(27)=I
  199.                     R(28)=R(28)+LOG(X(I))
  200.                     R(29)=R(29)+(LOG(X(I)))^2
  201.                     R(30)=R(30)+(LOG(Y(I)))
  202.                     R(31)=R(31)+(LOG(Y(I)))^2
  203.                     R(32)=R(32)+(LOG(X(I)))*(LOG(Y(I)))
  204.                     R(33)=I
  205.                     R(34)=R(34)+(X(I)/Y(I))
  206.                     R(35)=R(35)+(Y(I)/X(I))
  207.                     R(36)=R(36)+(X(I)^2)*Y(I)
  208.                     R(37)=R(37)+(X(I)^2)/Y(I)
  209.                     R(38)=R(38)+(Y(I)/X(I)^2)
  210.                     R(39)=R(39)+X(I)*Y(I)^2
  211.                     R(40)=R(40)+X(I)^3
  212.                     R(41)=R(41)+1/(X(I)^3)
  213.                     R(42)=R(42)+Y(I)^3
  214.                     R(43)=R(43)+X(I)^4
  215.                     R(44)=R(44)+1/(X(I)^4)
  216.                     R(45)=R(45)+LOG(X(I))/X(I)
  217.                     R(46)=R(46)+X(I)*LOG(Y(I))
  218.                     R(47)=R(47)+LOG(Y(I))/X(I)
  219.                     R(48)=R(48)+X(I)*LOG(X(I))
  220.                     R(49)=R(49)+(X(I)*LOG(X(I)))^2
  221.                     R(50)=R(50)+X(I)*LOG(X(I))*LOG(Y(I))
  222.                     R(51)=R(51)+Y(I)*LOG(X(I))
  223.                     R(52)=R(52)+LOG(X(I))/Y(I)
  224.                     R(53)=R(53)+((LOG(X(I))/X(I)))^2
  225.                     R(54)=R(54)+X(I)^2*LOG(Y(I))
  226.                     R(55)=R(55)+(LOG(X(I)))^3
  227.                     R(56)=R(56)+(LOG(X(I)))^4
  228.                     R(57)=R(57)+(LOG(X(I))^2)*LOG(Y(I))
  229.                     R(58)=R(58)+(LOG(Y(I))*LOG(X(I)))/X(I)
  230.                     R(59)=R(59)+LOG(1-X(I))
  231.                     R(60)=R(60)+(LOG(1-X(I)))^2
  232.                     R(61)=R(61)+LOG(X(I))*LOG(1-X(I))
  233.                     R(62)=R(62)+LOG(Y(I))*LOG(1-X(I))
  234.                     R(63)=R(63)+(LOG(X(I)))/X(I)
  235.  
  236.  
  237.  
  238.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 4
  239.  
  240.  
  241.  
  242.                                     CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  243.  
  244.  
  245.  EXAMPLE DATA ENTRY SCREEN
  246. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  247. ║ CURVEFIT  ║  Version 2.11-B  JULY 30, 1988      by Thomas S. Cox  ║SHAREWARE║
  248. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  249. ║ DATA ENTRY SCREEN| Press <ESC> for X or Y to Terminate Data Entry           ║
  250. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  251. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  252. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  253. ║  1│    2.0000│    3.1234│   │          │          │   │          │          ║
  254. ║  2│    3.1234│    5.0000│   │          │          │   │          │          ║
  255. ║  3│    3.0000│    4.7679│   │          │          │   │          │          ║
  256. ║  4│    5.0000│    7.0000│   │          │          │   │          │          ║
  257. ║  5│    6.0000│    9.0000│   │          │          │   │          │          ║
  258. ║  6│    9.0000│   12.0000│   │          │          │   │          │          ║
  259. ║  7│   10.0000│   15.0000│   │          │          │   │          │          ║
  260. ║  8│   11.0000│   17.0000│   │          │          │   │          │          ║
  261. ║  9│   12.0000│   17.0000│   │          │          │   │          │          ║
  262. ║ 10│   10.0000│   21.0000│   │          │          │   │          │          ║
  263. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  264. ║   │          │          │   │          │          │   │          │          ║
  265. ║   │          │          │   │          │          │   │          │          ║
  266. ║   │          │          │   │          │          │   │          │          ║
  267. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  268. ║ ENTER DATA ║PT #    11 ║X VALUE║ ? ░░░░░░░░░ ║Y VALUE║   21                 ║
  269. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  270.  
  271.  EXAMPLE DATA ADDITION SCREEN
  272. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  273. ║ CURVEFIT  ║  Version 2.11-B JULY 30, 1988       by Thomas S. Cox  ║SHAREWARE║
  274. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  275. ║ DATA ADDITION| Press <ESC> for X or Y to Terminate Data Entry               ║
  276. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  277. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  278. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  279. ║  1│ 199234.25│   12.0000│   │          │          │   │          │          ║
  280. ║  2│ 235439.98│   14.0000│   │          │          │   │          │          ║
  281. ║  3│ 332456.79│   14.2354│   │          │          │   │          │          ║
  282. ║  4│ 434532.56│   16.2345│   │          │          │   │          │          ║
  283. ║  5│ 567789.34│   19.0000│   │          │          │   │          │          ║
  284. ║  6│ 678905.00│   21.4356│   │          │          │   │          │          ║
  285. ║  7│ 745678.00│   24.0000│   │          │          │   │          │          ║
  286. ║  8│ 898324.21│   26.0000│   │          │          │   │          │          ║
  287. ║  9│ 902345.00│   26.0125│   │          │          │   │          │          ║
  288. ║ 10│ 998123.00│   27.0000│   │          │          │   │          │          ║
  289. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  290. ║   │          │          │   │          │          │   │          │          ║
  291. ║   │          │          │   │          │          │   │          │          ║
  292. ║   │          │          │   │          │          │   │          │          ║
  293. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  294. ║ ENTER DATA ║PT #     11║X VALUE║ ? ░░░░░░░░░ ║Y VALUE║                      ║
  295. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  296.  
  297.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 5
  298.  
  299.  
  300.  
  301.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  302.  
  303.  EXAMPLE DATA CORRECTION SCREEN
  304. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  305. ║ CURVEFIT  ║  Version 2.11-B  JUNE 6, 1988       by Thomas S. Cox  ║SHAREWARE║
  306. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  307. ║ DATA CORRECTION| <ESC> for Data # to Terminate; 'D' or 'd' for X or Y to DEL║
  308. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  309. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  310. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  311. ║  1│ 199234.25│        12│   │          │          │   │          │          ║
  312. ║  2│ 235439.98│        14│   │          │          │   │          │          ║
  313. ║  3│ 332456.79│   14.2354│   │          │          │   │          │          ║
  314. ║  4│ 434532.56│   16.2345│   │          │          │   │          │          ║
  315. ║  5│ 567789.34│        19│   │          │          │   │          │          ║
  316. ║  6│    678905│   21.4356│   │          │          │   │          │          ║
  317. ║  7│    745678│        24│   │          │          │   │          │          ║
  318. ║  8│ 898324.21│        26│   │          │          │   │          │          ║
  319. ║  9│    902345│   26.0125│   │          │          │   │          │          ║
  320. ║ 10│    998123│        27│   │          │          │   │          │          ║
  321. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  322. ║   │          │          │   │          │          │   │          │          ║
  323. ║   │          │          │   │          │          │   │          │          ║
  324. ║   │          │          │   │          │          │   │          │          ║
  325. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  326. ║ ENTER DATA ║PT # ?     ║X VALUE║             ║Y VALUE║                      ║
  327. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  328.  
  329.  EXAMPLE DATA LISTING SCREEN
  330. ╔═══════════╤═══════════════════════════════════════════════════════╤═════════╗
  331. ║ CURVEFIT  │ DATA LIST OF X AND Y VALUES  NOW IN MEMORY            │SHAREWARE║
  332. ╟───┬───────┴──┬──────────┬───┬──────────┬──────────┬───┬──────────┬┴─────────╢
  333. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  334. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  335. ║  1│ 199234.25│   12.0000│   │          │          │   │          │          ║
  336. ║  2│ 235439.98│   14.0000│   │          │          │   │          │          ║
  337. ║  3│ 332456.79│   14.2354│   │          │          │   │          │          ║
  338. ║  4│ 434532.56│   16.2345│   │          │          │   │          │          ║
  339. ║  5│ 567789.34│   19.0000│   │          │          │   │          │          ║
  340. ║  6│ 678905.00│   21.4356│   │          │          │   │          │          ║
  341. ║  7│ 745678.00│   24.0000│   │          │          │   │          │          ║
  342. ║  8│ 898324.21│   26.0000│   │          │          │   │          │          ║
  343. ║  9│ 902345.00│   26.0125│   │          │          │   │          │          ║
  344. ║ 10│ 998123.00│   27.0000│   │          │          │   │          │          ║
  345. ║   │          │          │   │          │          │   │          │          ║
  346. ║   │          │          │   │          │          │   │          │          ║
  347. ║   │          │          │   │          │          │   │          │          ║
  348. ║   │          │          │   │          │          │   │          │          ║
  349. ║   │          │          │   │          │          │   │          │          ║
  350. ║   │          │          │   │          │          │   │          │          ║
  351. ║   │          │          │   │          │          │   │          │          ║
  352. ║   │          │          │   │          │          │   │          │          ║
  353. ╚═══╧══════════╧══════════╧═══╧══════════╧══════════╧═══╧══════════╧══════════╝
  354.  
  355.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 6
  356.  
  357.  
  358.  
  359.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  360.  
  361.  
  362.  EXAMPLE CALCULATE AND REVIEW COEFFICIENTS SCREEN
  363. ╔═══════════╦════════════════════════════════════╦════════════════════════════╗
  364. ║ CURVEFIT  ║ LISTING OF CALCULATED COEFFICIENTS ║ BEST FIT EQUATION IS #  1  ║
  365. ╠════╤══════╩═════╤════════════╤════════════╤════╩═╤══════╤═══════════════════╣
  366. ║EQ #│ 'A' COEF.  │ 'B' COEF.  │ 'C' COEF.  │ R²   │R² COR│ EQUATION OF CURVE ║
  367. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  368. ║  1 │      8.4129│      0.0000│      0.0000│0.9863│0.9845│Y=A+B*X            ║
  369. ║  2 │      0.0000│      0.0000│      0.0000│0.0000│0.0000│Y=B*X              ║
  370. ║  3 │      0.0874│     -0.0000│      0.0000│0.9480│0.9415│Y=1/(A+B*X)        ║
  371. ║  4 │      7.5737│      0.0000│ 170373.7317│0.9865│0.9827│Y=A+B*X+C/X        ║
  372. ║  5 │     28.0942│-3.62127D+06│      0.0000│0.8232│0.8012│Y=A+B/X            ║
  373. ║  6 │      0.0290│  11240.0436│      0.0000│0.9255│0.9162│Y=X/(A*X+B)        ║
  374. ║  7 │     37.3358│-1.23010D+07│ 1.49430D+12│0.9663│0.9567│Y=A+B/X+C/X*X      ║
  375. ║  8 │      8.2991│      0.0000│     -0.0000│0.9863│0.9824│Y=A+B*X+C*X*X      ║
  376. ║  9 │      0.0001│     -0.0000│      0.0000│0.0000│0.0000│Y=A*X+B*X*X        ║
  377. ║ 10 │      0.0242│      0.5070│      0.0000│0.9683│0.9644│Y=A*X^B            ║
  378. ║ 11 │     10.4724│      1.0000│      0.0000│0.9766│0.9737│Y=A*B^X            ║
  379. ║ 12 │     29.9278│      0.0000│      0.0000│0.8804│0.8655│Y=A*B^(1/X)        ║
  380. ║ 13 │     10.8476│      0.0000│      0.0000│0.9741│0.9709│Y=A*X^(B*X)        ║
  381. ║ 14 │     31.1770│ -16802.8276│      0.0000│0.8899│0.8761│Y=A*X^(B/X)        ║
  382. ║ 15 │     10.4724│      0.0000│      0.0000│0.9766│0.9737│Y=A*e^(B*X)        ║
  383. ║ 16 │     29.9278│-197591.3563│      0.0000│0.8804│0.8655│Y=A*e^(B/X)        ║
  384. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  385. ║BEST│      8.4129│      0.0000│      0.0000│0.9863│0.9845│Y=A+B*X            ║
  386. ╚════╧════════════╧════════════╧════════════╧══════╧══════╧═══════════════════╝
  387.  
  388.  EXAMPLE DATA PREDICTION SCREEN  VERSION 2.11-B
  389. ╔═══════════╦═════════════╤═════╤══════╤════════════════════════════╦═════════╗
  390. ║ CURVEFIT  ║ PREDICTIONS │ EQ# │ 20   │ Y=A*B^(1/X)*X^C            ║VER 2.11B║
  391. ╠═══════╤═══╩═════════════╪═════╧╤═════╧═══════════╤══════╤═════════╩═════════╣
  392. ║ START │ 1               │ STOP │ 46              │ STEP │ .93               ║
  393. ╟───────┴────┬────────────┼──────┴─────┬───────────┴┬─────┴──────┬────────────╢
  394. ║X-DATA ENTRY│PREDICTED Y │X-DATA ENTRY│PREDICTED Y │X-DATA ENTRY│PREDICTED Y ║
  395. ╟────────────┼────────────┼────────────┼────────────┼────────────┼────────────╢
  396. ║      1.0000│      1.8395│     14.0200│     16.2888│     27.0400│     30.8502║
  397. ║      1.9300│      2.8013│     14.9500│     17.3293│     27.9700│     31.8898║
  398. ║      2.8600│      3.8198│     15.8800│     18.3698│     28.9000│     32.9294║
  399. ║      3.7900│      4.8511│     16.8100│     19.4102│     29.8300│     33.9689║
  400. ║      4.7200│      5.8872│     17.7400│     20.4505│     30.7600│     35.0083║
  401. ║      5.6500│      6.9255│     18.6700│     21.4908│     31.6900│     36.0477║
  402. ║      6.5800│      7.9648│     19.6000│     22.5310│     32.6200│     37.0870║
  403. ║      7.5100│      9.0048│     20.5300│     23.5712│     33.5500│     38.1263║
  404. ║      8.4400│     10.0452│     21.4600│     24.6112│     34.4800│     39.1655║
  405. ║      9.3700│     11.0857│     22.3900│     25.6512│     35.4100│     40.2046║
  406. ║     10.3000│     12.1263│     23.3200│     26.6912│     36.3400│     41.2438║
  407. ║     11.2300│     13.1669│     24.2500│     27.7310│     37.2700│     42.2828║
  408. ║     12.1600│     14.2076│     25.1800│     28.7708│     38.2000│     43.3218║
  409. ║     13.0900│     15.2482│     26.1100│     29.8106│     39.1300│     44.3608║
  410. ╟────────────┴───┬────────┴───────┬────┴───────────┬┴────────────┴──┬─────────╢
  411. ║ Coefficients   │A=       1.1282 │B=       1.6304 │C=       0.9979 │R²=0.9861║
  412. ╚════════════════╧════════════════╧════════════════╧════════════════╧═════════╝
  413.  
  414.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 7
  415.  
  416.  
  417.  
  418.                                      CURVEFIT 2.1A-A by Thomas S. Cox  7/29/88
  419.  
  420.  Example of BEST FIT Screen (Version 2.11-B)
  421. ╔═══════════╦═══════════════════════════════════════════════════╦═════════════╗
  422. ║ CURVEFIT  ║ SORTED LISTING OF EQUATIONS for CORRECTED R² >0.10║VERSION 2.11B║
  423. ╠════╤══════╩═════╤════════════╤════════════╤══════╤══════╤═════╩═════════════╣
  424. ║EQ #│ 'A' COEF.  │ 'B' COEF.  │ 'C' COEF.  │ R²   │R² COR│ EQUATION OF CURVE ║
  425. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  426. ║  1 │      8.4129│      0.0000│      0.0000│0.9863│0.9845│Y=A+B*X            ║
  427. ║  4 │      7.5737│      0.0000│ 170373.7317│0.9865│0.9827│Y=A+B*X+C/X        ║
  428. ║  8 │      8.2991│      0.0000│     -0.0000│0.9863│0.9824│Y=A+B*X+C*X*X      ║
  429. ║ 21 │     34.4751│1689809.6167│-2.16817D+12│0.9855│0.9813│Y=A*e^(((X-B)^2)/C)║
  430. ║ 22 │     11.2436│     11.3964│      6.4227│0.9844│0.9799│Y=A*e^((lnX-B)^2/C)║
  431. ║ 24 │     16.7261│1621200.2364│      0.2038│0.9830│0.9782│Y=A*(X/B)^C*e^(x/b)║
  432. ║ 19 │      0.9080│      1.0000│      0.2038│0.9830│0.9782│Y=A*B^X*X^C        ║
  433. ║ 25 │      0.0000│-1.14965D+06│      0.0354│0.9810│0.9756│Y=1/(A*(X+B)^2+C)  ║
  434. ║ 18 │      0.4264│     -0.0283│      0.0000│0.9775│0.9747│Y=1/(A+B*lnX)      ║
  435. ║ 15 │     10.4724│      0.0000│      0.0000│0.9766│0.9737│Y=A*e^(B*X)        ║
  436. ║ 11 │     10.4724│      1.0000│      0.0000│0.9766│0.9737│Y=A*B^X            ║
  437. ║ 13 │     10.8476│      0.0000│      0.0000│0.9741│0.9709│Y=A*X^(B*X)        ║
  438. ║ 10 │      0.0242│      0.5070│      0.0000│0.9683│0.9644│Y=A*X^B            ║
  439. ║  7 │     37.3358│-1.23010D+07│ 1.49430D+12│0.9663│0.9567│Y=A+B/X+C/X*X      ║
  440. ║    │            │            │            │      │      │                   ║
  441. ║    │            │            │            │      │      │                   ║
  442. ║    │            │            │            │      │      │                   ║
  443. ║    │            │            │            │      │      │                   ║
  444. ╚════╧════════════╧════════════╧════════════╧══════╧══════╧═══════════════════╝
  445.  
  446.  MISCELLANEOUS NOTES:
  447.  
  448.  
  449.   1.  LISTING DATA  Will show 54 data points per screen.  To view
  450.                     next 54 data points, press <ENTER>.
  451.  
  452.   2.  ADD DATA      When reading data into screen array, program
  453.                     will show latest, that is the highest numbered,
  454.                     set of 42 data points.  Prompt for PT# will be
  455.                     for one data point higher than currently existing
  456.                     number of data points.  Entering <ESC> for X or Y
  457.                     will terminate additions.
  458.  
  459.   3.  DELETE DATA   Screen will look similar to ADDITION screen.
  460.  
  461.                     IMPORTANT NOTE:  If 'S' is stored as a DATAPOINT,
  462.                                      that point will be last one
  463.                                      recognized, even if there is more
  464.                                      valid data.  Always exit from
  465.                                      this routine by entering <ESC> for any
  466.                                      data point number.                
  467.                                     
  468.  
  469.                     To change data, just enter point number and the new
  470.                     values for X and Y.
  471.  
  472.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE 8
  473.  
  474.  
  475.  
  476.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  477.  
  478.   4.  DATA FILES    Program will read a file that has blank lines in it such
  479.       WITH BLANK    as might be created with a word-processing program.  
  480.       LINES         CURVEFIT will insert 'DEL' at the appropriate places and
  481.                     delete them at the time of listing data or calculating
  482.                     equation coefficients.  Data file will automatically be
  483.                     condensed to fill slots occupied by 'DEL'.                 
  484.      
  485.   5.  COMPILED VS   The source code used to create the COMPILED version of
  486.       INTERPRETER   CURVEFIT should, at least in theory, function the same
  487.                     using INTREPETER BASIC.  It does not.  There are various  
  488.                     places where the source code used with CURVEFIT will crash
  489.                     including using FUNCTION KEYS for option selection and
  490.                     data formatting.  
  491.         
  492.   6.  MONITOR       Program is known to work satisfactorily with Hercules 
  493.                     compatible video cards, CGA cards, and EGA cards.
  494.                     MONOCHROME option from program is needed for some video
  495.                     cards.  With color monitors, color is high intensity white
  496.                     on blue.  
  497.   
  498.   7. COMPILER       When compiled with Microsoft's QUICK BASIC 3.0 the options
  499.      OPTIONS        to use are: /O /X /E /S.                                 
  500.  
  501.   8. OPTION         If the cursor keys are used to select options, it doesn't
  502.      SELECTION      matter whether or not the NUMBER-LOCK function is active
  503.      WITH CURSOR    since the program will also use 8 for the up arrow and 2  
  504.      KEYS           for the down arrow.                      
  505.   
  506.   9. MEANING OF     This occurs particularly for equation #2 as there was no
  507.      R^2 = ZERO     listing in the source material of a formula for this 
  508.                     value.  It is listed as zero to indicate that value was
  509.                     not calculated.
  510.  
  511.  10. MEANING OF     Some equations do not use C.  For those equations, C is
  512.      C = ZERO       listed as zero.  
  513.  
  514.  11. MEANING OF     For some data sets a number of the 25 equations used in
  515.      A, B, and C    this program are not usable.  In those cases, values
  516.      = ZERO         of A, B, and C are all set to zero.
  517.  
  518.  12. NUMBER OF      This program will handle up to 255 data points.
  519.      DATA POINTS
  520.  
  521.  13. DATA DISPLAY   ENTER DATA routine shows numbers with as much precision as
  522.                     possible.  Depending on magnitude of data, it will be
  523.                     displayed using one of the following formats
  524.                     #####.####, #######.##, or ##.##^^^^
  525.  
  526.                     LIST DATA and ADD DATA format is the same as for ENTER DATA 
  527.  
  528.                     DELETE or CORRECT routine shows the 10 left-most digits of
  529.                     number.  This is particularly useful for looking at small  
  530.                     numbers such as 0.002345, etc.  Note that using the DELETE
  531.                     of CORRECT routine to look at data does not necessarily 
  532.                     require one to delete or correct data.  Data are right
  533.                     justified within the 10 character limitation.
  534.  
  535.  Documentation for the CURVEFIT 2.11-B Program by Thomas S. Cox    PAGE  9
  536.  
  537.  
  538.  
  539.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  540.  
  541.  14. COEFFICIENT    This routine shows data either in the #######.#### or
  542.      LISTING        ##.#####^^^^ format depending on the number to be
  543.                     displayed.  In any case, up to 12 spaces will be allowed
  544.                     for this number.
  545.  
  546.  15. PREDICTION     Same format for data display as for COEFFICIENT LISTING. 
  547.  
  548.  16. DATA LISTING   No specific formatting routine is used so that all digits
  549.      TO PRINTER     are output.
  550.  
  551.  17. TRACKING DATA  To aid in keeping track of where data will be entered a
  552.      ENTRY ON       block of ░░░░░░░░░░░░░░ will mark the place.
  553.      SCREEN
  554.                     The last X and Y values entered will still be displayed
  555.                     at the bottom of the screen.  For example, for entering
  556.                     data point #2, the value of Y1 will still be displayed as
  557.                     the Y entry.  Important Note: It is not possible to enter
  558.                     a series of data points that are the same value as the
  559.                     previous entry by pressing ENTER.  Each data point MUST
  560.                     be individually entered.  Pressing ENTER will give the
  561.                     value 'DEL'.
  562.                         
  563.                     If data is entered using the DATA ENTER option and there
  564.                     are 'DEL' entries, these can be seen by calling up the
  565.                     DELETE routine.  LIST Data routine automatically packs 
  566.                     data and removes any DEL entries.                       
  567.                   
  568.  18. DATA FILE      Data is stored as two columns of X and Y data such that 
  569.      STORAGE        it may be read back into a program such as LOTUS, NWA
  570.      FORMAT         STATPAK, or the SHAREWARE program, CFIT.
  571.  
  572.  19. DATA FILE      Naturally will read data in format used for Storage,
  573.      FORMAT         one column of data with alternating X and Y values,
  574.      READABLE       either of the above with leading blank lines or inter-
  575.                     spersed blank lines.
  576.  
  577.  20. BEST FIT       Based on the value of R^2 corrected to account for 
  578.                     degrees of freedom.  Sorted by decreasing value of R^2.
  579.  
  580.  21. REFERENCE      CURVE FITTING for PROGRAMMABLE CALCULATORS 
  581.                     by William M. Kolb
  582.                     PUBLISHED by IMTEC  P. O. Box 1402 Bowie, MD  20716
  583.                            
  584.                     This reference gives a full explanation of the equations
  585.                     used in this program and includes excellent graphs 
  586.                     showing the shapes of curves described by these equations.
  587.  
  588.                     A program specifically for the HP-41CV that fits 19 of the
  589.                     25 equations of CURVEFIT is listed along with barcode for
  590.                     easy entry of program into HP-41.      
  591.  
  592.  22. FILES          CURVEFIT.BAS    (ASCII Source File) 
  593.      SUPPLIED WITH  CURVEFIT.EXE    Executable file compiled using Microsoft's
  594.      CURVEFIT                       Quick Basic Version 3.0
  595.                     CURVEFIT.DOC    This documentation file
  596.                     EX     *.*      Example Data Files                        
  597.  
  598.  
  599.  Documentation for the CURVEFIT program by Thomas S. Cox        Page 10
  600.  
  601.  
  602.  
  603.  
  604.                                      CURVEFIT 2.11-B by Thomas S. Cox  7/29/88
  605.  
  606.  
  607.  
  608. SHAREWARE
  609. =========
  610. This program is SHAREWARE.  That means that if you use it, a small donation
  611. of $10.00 is requested by the author.
  612.  
  613. Program may be freely copied and distributed so long as there is no more than
  614. a $10.00 copying and handling charge.  Also, the program should be distributed
  615. with no alterations to the files.  The documentation files and example files
  616. must be included with program.
  617.  
  618. Feel free to place this program on any bulletin board system.  The size of
  619. files would probably make this prohibitive but if files were squeezed or
  620. archived might be more practical.
  621.  
  622. The functioning of this program and the calculation of the coefficients
  623. has not changed significantly since the first edition of the IBM version
  624. was first published about July of 1985.  Changes have been made to
  625. improve the user interface and improve the data entry and data lists.
  626.  
  627. The author welcomes any comments and suggestions.
  628.  
  629. The author is:
  630.  
  631.                              Thomas S. Cox
  632.                              102 Evergreen Street
  633.                              Easley, SC  29640
  634.  
  635.  
  636. Note: Late change 4/4/88 information supplied by Jim Cargal on estimating the
  637.       value of R^2 for equation #2.  This has been incorporated into program.
  638.  
  639.       Listings for EQ #12 were previously in error as they did not show the
  640.       A coefficient.  This has been corrected.  Calculations and predictions
  641.       were correct.
  642.       
  643.       Added routine on 4/8/88 to allow storage of predicted values to a
  644.       Disk file.    
  645.  
  646.       Changed data entry, addition, and correction routines on 6/6/88 to allow
  647.       using <ESC> to terminate data entry.
  648.  
  649.       Improper initialization of A, B, C, R^2, and RC^2 corrected 7/5/88.
  650.  
  651.                     End of Document File 7/29/88
  652.  
  653.  
  654.  Documentation for the CURVEFIT 2.10-V Program by Thomas S. Cox    PAGE 11
  655.  
  656.